//package com.sztz.service.impl;
//
//import cn.hutool.core.util.ObjectUtil;
//import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
//import com.sztz.entity.User;
//import com.sztz.mapper.UserMapper;
//import com.sztz.result.ResultEnum;
//import com.sztz.service.UserService;
//import lombok.AllArgsConstructor;
//import org.springframework.security.authentication.BadCredentialsException;
//import org.springframework.stereotype.Service;
//
///**
// * 用户信息相关服务
// * @author yzy
// * @date 2023/4/11 15:15
// */
//@Service
//@AllArgsConstructor
//public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {
//
//    private final UserMapper userMapper;
//    /***
//     * 根据登录账户获取用户信息
//     * @param username 用户登录账号名
//     * @return com.tzcloud.entity.User
//     * @author yzy
//     * @date 2023/3/22 14:53
//     */
//    @Override
//    public User loadUserByUsername(String username)  {
//        //根据登录账户名查询已启用未删除的唯一一条记录
//        User user = userMapper.selectByLoginCode(username);
//        if(ObjectUtil.isNull(user)){
//            throw new BadCredentialsException(ResultEnum.LOGIN_AUTHENTICATION_FAIL.getMessage());
//        }
//        return user;
//    }
//}
